import request from '@/router/axios';
import {
  fenExYuangettoFixed,
  getLineName,
  getStationName,
  getXieChaStatusFormat,
  xieChaStatus
} from "../../../../commonCheck";

/**
 * 售票员票款差异待协查
 * @param query
 */
export async function getSwAuConductorToBeCheckedList(query) {
  return request({
    url: '/check/check/getSwAuConductorToBeCheckedList',
    method: 'post',
    params: query
  });
}

/**
 * 售票员票款差异待协查-替換功能
 * @param query
 */
export async function replaceSwAuConductorToBeChecked(query) {
  return request({
    url: '/check/check/replaceSwAuConductorToBeChecked',
    method: 'post',
    params: query
  });
}

/**
 * 售票员票款差异待协查-下发协查
 * @param query
 */
export async function sendStatusSwAuConductorToBeChecked(query) {
  return request({
    url: '/check/check/sendStatusSwAuConductorToBeChecked',
    method: 'post',
    data: query
    //params: query
  });
}

//删除
export function delBatch(id) {
  return request({
    url: '/check/check/batchSPYDel',
    method: 'delete',
    data:id
  })
}

export const cols1= {
  emptyBtn: false,
  editBtn: false,
  delBtn: false,
  addBtn: false,
  border: true,
  index: false,
  menu:false,
  refreshBtn:false,
  columnBtn:false,
  indexLabel: '序号',
  page: false,
  align: 'center',
  menuWidth: 150,
  menuAlign: 'center',
  selection: false,
  reserveSelection: false,
  column:[{label:"线路",
    "prop":"lineCode",type:'select',formatter: function(row, value , label, column){
      return getLineName(value);
    }},
    {label:"站点",
      "prop":"stationCode",type:'select',formatter: function(row, value , label, column){
        return getStationName(row.lineCode,value);
      }},
    {label:"售票员名称",width: 120,
      "prop":"conductorPersonName"},
    {label:"售票员操作号",width: 120,
      "prop":"conductorPersonCode"},
    {label:"设备操作号",width: 120,
      "prop":"equipmentNumber",type:'select'},
    {label:"bom编号",
      "prop":"bomCode"},
    {label:"实收金额",
      "prop":"paidAmount",formatter:function (row,value , label, column) {
        return fenExYuangettoFixed(row,'paidAmount');
      }},
      {label:"协查售票金额",width: 120,
      "prop":"replySaleMoney",formatter:function (row,value , label, column) {
        return fenExYuangettoFixed(row,'replySaleMoney');
      }},
    {label:"协查充值金额",width: 120,
      "prop":"replyRechargeMoney",formatter:function (row,value , label, column) {
        return fenExYuangettoFixed(row,'replyRechargeMoney');
      }},
    {label:"协查补票金额",width: 120, "prop":"replyErrorReturnMoney",formatter:function (row,value , label, column) {
        return fenExYuangettoFixed(row,'replyErrorReturnMoney');
      }},
    {label:"差异金额", "prop":"diffMoney",formatter:function (row,value , label, column) {
        return fenExYuangettoFixed(row,'diffMoney');
      }},
    {label:"加入协查时间", "prop":"assistTime",type:'date',
      width: 120,format:'yyyy-MM-dd'},
    {label:"协查状态",
      "prop":"assistState",type:'select',dicData:xieChaStatus(),
      formatter:function(row, value , label, column){
        return getXieChaStatusFormat(value);
      }},
  ]
}
